package com.eop.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 应急阶段
 * 
 */
@Entity
@Table(name = "eop_EmergencyStage")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@NamedQueries( { @NamedQuery(name = "es.getStageByEvent", query = "from EmergencyStage as sr where sr.esEvent.id=? and sr.delFlag=false order by stageDate desc"),
				 @NamedQuery(name = "es.getAllStage", query = "from EmergencyStage as sr where sr.delFlag=false order by stageDate desc")})
public class EmergencyStage {

	/**
	 * ID
	 */
	@Id
	private String id;

	/**
	 * 阶段内容
	 */
	@Basic(fetch = FetchType.LAZY)
	@Column(columnDefinition = "text")
	private String stage_content;

	/**
	 * 所属一级阶段
	 */
	private String stage_b;

	/**
	 * 所属二级阶段
	 */
	private String stage_s;

	/**
	 * 阶段日期
	 */
	private Date stageDate;

	/**
	 * 创建者
	 */
	private String createUser;
	/**
	 * 创建时间
	 */
	private Date createDate;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "eventId")
	private Event esEvent;

	private boolean delFlag;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getStage_content() {
		return stage_content;
	}

	public void setStage_content(String stageContent) {
		stage_content = stageContent;
	}

	public String getStage_b() {
		return stage_b;
	}

	public void setStage_b(String stageB) {
		stage_b = stageB;
	}

	public String getStage_s() {
		return stage_s;
	}

	public void setStage_s(String stageS) {
		stage_s = stageS;
	}

	public Date getStageDate() {
		return stageDate;
	}

	public void setStageDate(Date stageDate) {
		this.stageDate = stageDate;
	}

	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Event getEsEvent() {
		return esEvent;
	}

	public void setEsEvent(Event esEvent) {
		this.esEvent = esEvent;
	}

	public boolean isDelFlag() {
		return delFlag;
	}

	public void setDelFlag(boolean delFlag) {
		this.delFlag = delFlag;
	}
}
